import request from '@/utils/request'

// 理发套餐API接口

/**
 * 新增套餐
 */
export function addHaircutPackage(data) {
  return request({
    url: '/haircut-package',
    method: 'post',
    data
  })
}

/**
 * 删除套餐
 */
export function deleteHaircutPackage(id) {
  return request({
    url: `/haircut-package/${id}`,
    method: 'delete'
  })
}

/**
 * 更新套餐
 */
export function updateHaircutPackage(id, data) {
  return request({
    url: `/haircut-package/${id}`,
    method: 'put',
    data
  })
}

/**
 * 根据ID查询套餐
 */
export function getHaircutPackageById(id) {
  return request({
    url: `/haircut-package/${id}`,
    method: 'get'
  })
}

/**
 * 查询所有套餐
 */
export function getAllHaircutPackages() {
  return request({
    url: '/haircut-package/list',
    method: 'get'
  })
}

/**
 * 查询所有启用的套餐
 */
export function getAllEnabledHaircutPackages() {
  return request({
    url: '/haircut-package/enabled',
    method: 'get'
  })
}

/**
 * 分页查询套餐
 */
export function getHaircutPackagePage(params) {
  return request({
    url: '/haircut-package/page',
    method: 'get',
    params
  })
}

/**
 * 检查套餐名称是否存在
 */
export function checkPackageNameExists(packageName, excludeId) {
  return request({
    url: '/haircut-package/check-name',
    method: 'get',
    params: {
      packageName,
      excludeId
    }
  })
}

/**
 * 更新套餐状态
 */
export function updatePackageStatus(id, status) {
  return request({
    url: `/haircut-package/${id}/status`,
    method: 'put',
    params: { status }
  })
}

/**
 * 启用套餐
 */
export function enablePackage(id) {
  return request({
    url: `/haircut-package/${id}/enable`,
    method: 'put'
  })
}

/**
 * 禁用套餐
 */
export function disablePackage(id) {
  return request({
    url: `/haircut-package/${id}/disable`,
    method: 'put'
  })
}

/**
 * 获取套餐统计信息
 */
export function getPackageStatistics() {
  return request({
    url: '/haircut-package/statistics',
    method: 'get'
  })
} 